﻿
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using GTI = Gadgeteer.Interfaces;

namespace Gadgeteer.Modules.Sytech
{
    /// <summary>
    /// Represents a USB Device module that allows the mainboard to be programmed over USB.  
    /// Red USB Device modules also apply USB power (5V) to the mainboard and peripherals. 
    /// </summary>
    /// <remarks>
    /// <para>
    /// The <see cref="UsbDevice"/> class has no programmable functionality other than internally reserving 
    /// the pins used by the USB Device module, which allows programming of the mainboard.  
    /// Red USB Device modules also provide power to the mainboard and peripherals from the USB power source.  
    /// Important: only plug in one Red module at a time.
    /// </para>
    /// </remarks>
    public class USBDevice : GTM.Module
    {
        /// <summary></summary>
        /// <param name="socketNumber">The mainboard socket that has the module plugged into it.</param>
        public USBDevice(int socketNumber)
        {
            
            Socket socket = Socket.GetSocket(socketNumber, true, this, null);
            socket.EnsureTypeIsSupported('D', this);

            // The only pins required for this module:
            socket.ReservePin(Socket.Pin.Three, this);
            socket.ReservePin(Socket.Pin.Four, this);

        }
    }

}

   

